package com.yh.rbac.service.impl;

import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.yh.rbac.dao.UserMapper;
import com.yh.rbac.entity.User;
import com.yh.rbac.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	@Resource
	private UserMapper userMapper ;

	@Transactional(propagation=Propagation.REQUIRED)
	@Override
	public int deleteByPrimaryKey(Long id) {
		return userMapper.deleteByPrimaryKey(id) ;
	}

	@Transactional(propagation = Propagation.REQUIRED)
	@Override
	public int insert(User record) {
		return userMapper.insert(record) ;
	}

	@Override
	public User selectByPrimaryKey(Long id) {
		return userMapper.selectByPrimaryKey(id) ;
	}

	@Override
	public List<User> selectAll() {
		return userMapper.selectAll() ;
	}

	@Override
	public int updateByPrimaryKey(User record) {
		return userMapper.updateByPrimaryKey(record) ;
	}

	@Override
	public User selectByEmailAndPassword(String email , String password) {
		return userMapper.selectByEmailAndPassword(email, password) ;
	}

	@Override
	public List<User> selectByFindContent(String findContent, String findType) {
		return  userMapper.selectByFindContent(findContent, findType);
	}
}
